package io.zhaocy.acmspringboot;

import com.alibaba.edas.acm.ConfigService;
import com.alibaba.edas.acm.domain.ConfigKey;
import com.alibaba.edas.acm.exception.ConfigException;
//import com.snowball.acm.spring.annotation.EnableSbtACM;
//import io.zhaocy.springbootenable.selector.EnableLogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;

import java.util.List;

@SpringBootApplication
//@EnableStorage
//@EnableLogInfo(name = {"onlySale"})
//@EnableSbtACM(value = {"-public1","-public2"})
public class AcmSpringbootApplication {

    @Autowired
    private Environment environment;

    public static void main(String[] args) {
        SpringApplication.run(AcmSpringbootApplication.class, args);

        /*try {
            String config = ConfigService.getConfig("com.snowball.cloud:global.properties","DEFAULT_GROUP",3000);
            System.out.println(config);
        } catch (ConfigException e) {
            e.printStackTrace();
        }*/

        try {
            List<ConfigKey> list = ConfigService.getConfigs(1000);
            for (ConfigKey ck : list) {
                System.out.println("dataId: "+ck.getDataId()+" group: "+ck.getGroup());
            }
        } catch (ConfigException e) {
            e.printStackTrace();
        }
    }
}
